home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / include / dos / dosextens.h next >
C/C++ Source or Header  |  1996-09-12  |  4KB  |  172 lines

  1. #ifndef _DOS_DOSEXTENS_H_
  2. #define _DOS_DOSEXTENS_H_
  3.  
  4. #include <exec/tasks.h>
  5. #include <exec/ports.h>
  6. #include <exec/libraries.h>
  7. #include <exec/semaphores.h>
  8. #include <devices/timer.h>
  9. #include <exec/interrupts.h>
  10. #include <dos/dos.h>
  11.  
  12. struct DosLibrary
  13. {
  14.     /* No public fields in there */
  15.     struct Library dl_lib;
  16.     struct ErrorString *dl_Errors;
  17.     struct timerequest *dl_TimeReq;
  18.     struct Library *dl_UtilityBase;
  19.     struct Library *dl_IntuitionBase;
  20.     struct SignalSemaphore dl_DosListLock;
  21.     struct DosList *dl_DevInfo;
  22.     struct ExecBase *dl_SysBase;
  23.     BPTR dl_SegList;
  24.     struct Device *dl_NulHandler;
  25.     struct Unit *dl_NulLock;
  26.  
  27.     struct SignalSemaphore dl_LDSigSem;
  28.     struct Interrupt dl_LDHandler;
  29.     APTR dl_LDOpenLibrary;
  30.     APTR dl_LDOpenDevice;
  31.     struct Process *dl_LDDemon;
  32.     STRPTR dl_LDName;
  33.     struct Process *dl_LDCaller;
  34.     APTR dl_LDPtr;
  35.     LONG dl_LDReturn;
  36.  
  37.     ULONG dl_ProcCnt;
  38.     ULONG dl_Flags;
  39. };
  40.  
  41. #define RNF_WILDSTAR 0x1000000
  42.  
  43. struct CommandLineInterface
  44. {
  45.     LONG cli_Result2;
  46.     BSTR cli_SetName;
  47.     BPTR cli_CommandDir;
  48.     LONG cli_ReturnCode;
  49.     BSTR cli_CommandName;
  50.     LONG cli_FailLevel;
  51.     BSTR cli_Prompt;
  52.     BPTR cli_StandardInput;
  53.     BPTR cli_CurrentInput;
  54.     BSTR cli_CommandFile;
  55.     LONG cli_Interactive;
  56.     LONG cli_Background;
  57.     BPTR cli_CurrentOutput;
  58.     LONG cli_DefaultStack;
  59.     BPTR cli_StandardOutput;
  60.     BPTR cli_Module;
  61. };
  62.  
  63. struct Process
  64. {
  65.     struct Task pr_Task;
  66.     struct MsgPort pr_MsgPort;
  67.     WORD pr_Pad;
  68.     BPTR pr_SegList;
  69.     LONG pr_StackSize;
  70.     APTR pr_GlobVec;
  71.     LONG pr_TaskNum;
  72.     BPTR pr_StackBase;
  73.     LONG pr_Result2;
  74.     BPTR pr_CurrentDir;
  75.     BPTR pr_CIS;
  76.     BPTR pr_COS;
  77.     APTR pr_ConsoleTask;
  78.     APTR pr_FileSystemTask;
  79.     BPTR pr_CLI;
  80.     APTR pr_ReturnAddr;
  81.     APTR pr_PktWait;
  82.     APTR pr_WindowPtr;
  83.     BPTR pr_HomeDir;
  84.     LONG pr_Flags;
  85.     void (*pr_ExitCode)();
  86.     LONG pr_ExitData;
  87.     STRPTR pr_Arguments;
  88.     struct MinList pr_LocalVars;
  89.     ULONG pr_ShellPrivate;
  90.     BPTR pr_CES;
  91. };
  92.  
  93. /* pr_Flags (all private) */
  94. #define    PRB_FREESEGLIST    0
  95. #define    PRF_FREESEGLIST    1
  96. #define    PRB_FREECURRDIR    1
  97. #define    PRF_FREECURRDIR    2
  98. #define    PRB_FREECLI    2
  99. #define    PRF_FREECLI    4
  100. #define    PRB_CLOSEINPUT    3
  101. #define    PRF_CLOSEINPUT    8
  102. #define    PRB_CLOSEOUTPUT    4
  103. #define    PRF_CLOSEOUTPUT    16
  104. #define    PRB_FREEARGS    5
  105. #define    PRF_FREEARGS    32
  106. #define PRB_CLOSEERROR    6
  107. #define PRF_CLOSEERROR    64
  108.  
  109. #define LDB_READ    0
  110. #define LDF_READ    1
  111. #define LDB_WRITE    1
  112. #define LDF_WRITE    2
  113. #define LDB_DEVICES    2
  114. #define LDF_DEVICES    4
  115. #define LDB_VOLUMES    3
  116. #define LDF_VOLUMES    8
  117. #define LDB_ASSIGNS    4
  118. #define LDF_ASSIGNS    16
  119. #define LDB_ENTRY    5
  120. #define LDF_ENTRY    32
  121. #define LDB_DELETE    6
  122. #define LDF_DELETE    64
  123. #define LDF_ALL        (LDF_DEVICES|LDF_VOLUMES|LDF_ASSIGNS)
  124.  
  125. struct FileHandle
  126. {
  127.     APTR fh_Dummy1;
  128.     APTR fh_Dummy2;
  129.     APTR fh_Dummy3;
  130.     UBYTE *fh_Buf;
  131.     UBYTE *fh_Pos;
  132.     UBYTE *fh_End;
  133.     ULONG fh_Size;
  134.     ULONG fh_Flags;
  135.     struct Device *fh_Device;
  136.     struct Unit *fh_Unit;
  137.     LONG fh_Dummy4;
  138. };
  139.  
  140. #define FHF_WRITE    (~0ul/2+1)
  141. #define FHF_BUF        1
  142.  
  143. struct DosList
  144. {
  145.     struct DosList *dol_Next;
  146.     LONG dol_Type;
  147.     APTR dol_Dummy1;
  148.     LONG dol_Dummy2;
  149.     LONG dol_Dummy3[6];
  150.     BSTR dol_OldName;        /* Compatibility */
  151.     STRPTR dol_Name;
  152.     struct Device *dol_Device;
  153.     struct Unit *dol_Unit;
  154. };
  155.  
  156. /* dl_Type type values */
  157. #define DLT_DEVICE    0
  158. #define DLT_DIRECTORY    1
  159. #define DLT_VOLUME    2
  160. #define DLT_LATE    3 /* Not yet */
  161. #define DLT_NONBINDING    4 /* Not yet */
  162.  
  163. #define ST_ROOT        1
  164. #define ST_USERDIR    2
  165. #define ST_SOFTLINK    3
  166. #define ST_LINKDIR    4
  167. #define ST_FILE        -3
  168. #define ST_LINKFILE    -4
  169. #define ST_PIPEFILE    -5
  170.  
  171. #endif
  172.